package Model;

import Model.permission.Permission;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.List;

public class UserWechat implements GeneralUser{
    public static final int ROLE_ID = 3;
    private int id;
    private int role_id;
    private String name;
    private String gender;
    private int age;
    private String phone_number;
    private String id_number;
    private String open_id;
    private String session_key;

    @JSONField(serialize = false)
    @JsonIgnore
    private List<Permission> permissions;   //权限列表

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public Integer getRole_id() {
        return UserWechat.ROLE_ID;
    }

    public void setRole_id(int role_id) {
        this.role_id = role_id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getPhone_number() {
        return phone_number;
    }

    public void setPhone_number(String phone_number) {
        this.phone_number = phone_number;
    }

    public String getId_number() {
        return id_number;
    }

    public void setId_number(String id_number) {
        this.id_number = id_number;
    }

    public String getOpen_id() {
        return open_id;
    }

    public void setOpen_id(String open_id) {
        this.open_id = open_id;
    }

    public String getSession_key() {
        return session_key;
    }

    public void setSession_key(String session_key) {
        this.session_key = session_key;
    }

    @Override
    public String getUser_number() {
        return getId_number();
    }

    @Override
    public String getUser_name() {
        return this.getName();
    }


    @Override
    public Integer getUser_id() {
        return getId();
    }

    @Override
    public List<Permission> getPermissions() {
        return permissions;
    }

    @Override
    public void setPermissions(List<Permission> allPermissions) {
        this.permissions = allPermissions;
    }
}
